$.ajaxPrefilter(function (options) {
    options.url = 'http://api-breakingnews-web.itheima.net' + options.url
    console.log(options.url);

    //includes   是否包含
    if (options.url.includes('/my/')) {
        options.headers = {
            Authorization:localStorage.getItem("token")|| ""
        }
    }


    options.complete = function (res) {
        console.log(res);
        if (res.responseJSON.status === 1 && res.responseJSON.message === '身份认证失败！') {
            localStorage.removeItem("token")
            location.href = '/login.html'
        }
    }
})